﻿#ifndef __BASE_DECODER_H__
#define __BASE_DECODER_H__

#include "miniui/minitypes.h"
#include "io/iostub.h"

namespace MiniUI
{

#define DECODE_STATUS_INIT                 0
#define DECODE_STATUS_READY                1
#define DECODE_STATUS_ZOMBIE               2

typedef struct tagDecodeFormat
{
    /* image info */
    int width;
    int height;

    /* out format */
    byte *pOutBuffer;
    int nOutWidthBytes;

}DecodeFormat;

class BaseDecoder
{
public:
    BaseDecoder(BaseIOStub* iostub);
    virtual ~BaseDecoder();

    virtual bool ReadImageInfo(DecodeFormat* deco);
    virtual bool ReadImageFrame(DecodeFormat* deco);
    virtual bool FinishDecode(DecodeFormat* deco);
protected:
    BaseIOStub* m_iostub;
};

}

#endif